﻿using Domain.Entitys.DB;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Domain.IRepositorys.DB
{
    public interface IDb_ProductRepository
    {
        /// <summary>
        /// 分页条件查询产品信息
        /// </summary>
        /// <param name="proName">产品名称/编码</param>
        /// <param name="typeCode">类型编码</param>
        /// <returns></returns>
        List<Db_Product> Get_Products(string proName, string typeCode, int currentPage, int pageSize);

        /// <summary>
        /// 条件查询产品总数
        /// </summary>
        /// <param name="proName"></param>
        /// <param name="typeCode"></param>
        /// <returns></returns>
        int ProductCount(string proName, string typeCode);

        /// <summary>
        /// 添加产品基础信息
        /// </summary>
        /// <param name="db_Product"></param>
        /// <returns></returns>
        Task<string> ProductAddAsync(Db_Product db_Product);

        /// <summary>
        /// 验证序号是否唯一
        /// </summary>
        /// <param name="sort"></param>
        /// <param name="proTypeId"></param>
        /// <returns></returns>
        bool CheckSortUnique(int sort, int proId);

        /// <summary>
        /// 逻辑删除产品信息
        /// </summary>
        /// <param name="db_Product"></param>
        /// <returns></returns>
        Task<int> ProductDelAsync(Db_Product db_Product);

        /// <summary>
        /// 根据编号查询对应的产品信息
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        Task<Db_Product> GetDb_ProductByCode(string code);

        /// <summary>
        /// 修改产品信息
        /// </summary>
        /// <param name="db_Product"></param>
        /// <returns></returns>
        Task<int> ProductUpdateAsync(Db_Product db_Product);


        /// <summary>
        /// 分页条件查询产品信息--其他入库单查询
        /// </summary>
        /// <param name="proName">产品名称/编码</param>
        /// <param name="typeCode">类型编码</param>
        /// <returns></returns>
        List<Db_Product> Get_Products_Other(string procode, string Measure_id, int currentPage, int pageSize);

        /// <summary>
        /// 条件查询产品总数--其他入库单的查询
        /// </summary>
        /// <param name="proName"></param>
        /// <param name="typeCode"></param>
        /// <returns></returns>
        int ProductCount_Other(string procode, string Measure_id);
    }
}
